package cn.lzx.industry.factory;

import cn.lzx.Bootstrap;
import cn.lzx.industry.material.Pig;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Component;

/**
 * Created by lizhenxing on 2018/2/2.
 */
@Component
public class MeatFactory {

    public Pig producePig(Pig pig) {
        return pig;
    }

    public static void main(String[] args) throws Exception {
        ConfigurableApplicationContext context = Bootstrap.start();
        MeatFactory meatFactory = context.getBean(MeatFactory.class);
        Pig pig = new Pig();
        pig.setName("我是一只猪");
        pig.setWeight(100);
        Pig producePig = meatFactory.producePig(pig);
        System.out.println(producePig);
    }
}
